package com.spring.annotation_profile_demo;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class App {
	public static void main(String[] args) {
		AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
		ctx.getEnvironment().setActiveProfiles("dev");
		ctx.register(DevConfig.class, ProConfig.class);
		ctx.refresh();
		BeanTest property = (BeanTest) ctx.getBean("property");
		String password = property.getPassword();
		String url = property.getUrl();
		System.out.println(url);
	}
}
